<?php
//弹出窗口模版数据读取
namespace Admin\Widget;
use Think\Controller;
class WindowsWidget extends Controller {

	
	//弹出窗口部件(角色添加)
	public function Role_add(){
		
		$fl			= D('Fungro','Logic');
		$oa			= D('Operauth','Logic');
		$FGlist		= $fl->getAllList();
		
		foreach($FGlist as $k => $v){
			foreach($v['subFG'] as $i => $w){
				$condition['fid']					= $w['id'];
				$FGlist[$k]['subFG'][$i]['subOA']	= $oa->getList($condition);
			}
		}
		
		$this->assign('FGlist',$FGlist);
		$this->display('System:role_add');
	}

	//弹出窗口部件(角色修改)
	public function Role_update(){
		
		$fl			= D('Fungro','Logic');
		$oa			= D('Operauth','Logic');
		$FGlist		= $fl->getAllList();
		
		foreach($FGlist as $k => $v){
			foreach($v['subFG'] as $i => $w){
				$condition['fid']					= $w['id'];
				$FGlist[$k]['subFG'][$i]['subOA']	= $oa->getList($condition);
			}
		}
		
		$this->assign('FGlist',$FGlist);
		$this->display('System:role_alter');
	}

	//弹出窗口部件(管理员帐号添加)
	public function User_add(){
		
		$Role			= D('Role','Logic');
		$RoleList		= $Role->getList();
		
		$this->assign('RoleList',$RoleList);
		$this->display('System:user_add');
	}	

	//弹出窗口部件(管理员帐号修改)
	public function User_update(){
		
		$Role			= D('Role','Logic');
		$RoleList		= $Role->getList();
		
		$this->assign('RoleList',$RoleList);
		$this->display('System:user_alter');
	}
	
}